package cn.sumpu.app.guoguojie.biz;

import java.util.List;

import javax.servlet.http.HttpServletRequest;

import cn.sumpu.app.guoguojie.domain.Detail;
import cn.sumpu.app.guoguojie.domain.Family;
import cn.sumpu.app.guoguojie.domain.Member;
import cn.sumpu.app.guoguojie.domain.Ext.Baby;
import cn.sumpu.app.guoguojie.domain.Ext.MemberExt;
import cn.sumpu.app.guoguojie.exception.AppBusinessException;
import cn.sumpu.app.guoguojie.util.PageModel;

public interface MemberBiz {
	
	public List<Member> login(String loginName,String pwd) throws AppBusinessException;

	public Member login(Member member) throws AppBusinessException;

	public Member login(Family family, Member member)
			throws AppBusinessException;
	
	public List<Member> getMemberPwdEmail(String pwd,String email)throws AppBusinessException;
	
	public List<Member> getMemberPwdDoorplate(String pwd,String doorplate)throws AppBusinessException;
	
	public Member getMemberPwdDoorplateEmail(String pwd,String doorplate,String email)throws AppBusinessException;
	
	public List<Member> getMemberPwdMobile(String pwd,String mobile)throws AppBusinessException;
	
	public Member getMemberById(String id)throws AppBusinessException;
	
	public void updateMember(Member member) throws AppBusinessException ;
	
	public Member addMember(String basePath, Member member) throws AppBusinessException ;
	
	public void addBaby(Baby baby) throws AppBusinessException ;
	
	public PageModel getPageModel(Member member,Integer page)throws AppBusinessException;
	public Member getMemberEmail(String email) throws AppBusinessException;
	
	public MemberExt getBaseInfo(String id) throws AppBusinessException ;
	
	public void saveBaseInfo(MemberExt memberExt) throws AppBusinessException ;
	
	public List<Baby> getBabyList(String member) throws AppBusinessException ;
	
	public String cutAvatar(HttpServletRequest request,String srcImg, int xCoords,int yCoords, int destWidth, int destHeight,int divWidth ,int divHeight)
			throws AppBusinessException;
	
	public List<Member> getMemberListByDoorplate(String doorplate) throws AppBusinessException;
	
	//根据标识号删除宝宝信息
	public void deleteBabyInfo(String identifier) throws AppBusinessException;
	
	//修改登录用户的信息
	void updateLoginMember(Member member, Detail detail) throws AppBusinessException;
	
	/**
	 * author 				Bruce Zhang
	 * @param basePath		服务器路径
	 * @param member		发给邮件的接受会员
	 * @throws AppBusinessException
	 */
	public void sendEmailToMember(String basePath, Member member) throws AppBusinessException;
	
	/**
	 * 根据门牌号取得爸爸妈妈的集合
	 * @param doorplate			门牌号
	 * @throws AppBusinessException
	 */
	public List<Member> getParentListByDoorplate(String doorplate) throws AppBusinessException;
	
	/**
	 * 根据门牌号得到户主的密码
	 * @param doorplate			门牌号
	 * @throws AppBusinessException
	 */
	public String getHostPwdByDoorplate(String doorplate) throws AppBusinessException;
	
	/**
	 * 根据门牌号户主的密码
	 * @param doorplate			门牌号
	 * @throws AppBusinessException
	 */
	public void setAccount(Member member) throws AppBusinessException;
	
	/**
	 * 根据门牌号取得户主的信息
	 * @param doorplate			门牌号
	 * @throws AppBusinessException
	 */
	public Member getHostInfoByDoorplate(String doorplate) throws AppBusinessException;
	
}
